<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateInvoiceTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('invoice', function (Blueprint $table) {
            $table->increments('id');
            $table->string('userId')->comment('用户id');
            $table->string('orderId')->comment('订单id');
            $table->string('title')->comment('发票抬头');
            $table->string('taxesNo')->comment('纳税人识别号');
            $table->string('name')->comment('姓名');
            $table->string('mobile')->comment('手机号');
            $table->string('address')->comment('收货地址');
            $table->integer('createdAt')->comment('创建时间');
            $table->integer('updatedAt')->comment('最后更新时间');
        });
        DB::statement("ALTER TABLE `invoice` comment '发票信息表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('invoice');
    }
}
